package com.novel.common.vo;

import com.novel.pojo.novel.Novel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class NovelMailVo {

    private String novelName;//小说名字
    private String novelIntroduction;//小说简介
    private Long novelClick;//小说点击量
    private Long novelRecommend;//小说推荐票数量
    private Date createdTime;//创建时间
    private Date lastTime;//最近更新时间
    private Double rewardAmount;//打赏总数


    public static NovelMailVo convert(Novel novel) {
        NovelMailVo novelMailVo = NovelMailVo.builder()
                .createdTime(novel.getCreateTime())
                .lastTime(novel.getLastTime())
                .novelClick(novel.getNovelClick())
                .novelIntroduction(novel.getNovelIntroduction())
                .novelRecommend(novel.getNovelRecommend())
                .build();

        return novelMailVo;
    }

}